#ifndef TERRAGE_CONFIG_H_INCLUDED
#define TERRAGE_CONFIG_H_INCLUDED

namespace TerraGE {
    class Config {
        private:
            ALLEGRO_CONFIG *cfg;
            string name;
        public:
            // Basic constructor for the Configuration file.
            // It shall open a configuration file with the given name
            // If it doesn't exist, it'll create it
            Config(string nm);

            // Saves the config file to disk with the current name
            void Save();

            // Interface
            string Get_Name() {return name;}
            void Set_Name(string v) {name = v;}

            // Sets the value of an specified config variable, depending on the
            // type. If the section or variable doesn't exist, it'll create them.
            void Set_Float(string section, string name, float v);
            void Set_String(string section, string name, string v);

            // Gets the current value of the specified config variable.
            // If it doesn't exist, it'll used the passed default value,
            // and also create the corresponding sections and variables
            // in the file.
            float Get_Float(string section, string name, float def=0);
            string Get_String(string section, string name, string def="");

            vector<string> Get_Sections();
    };
}


#endif
